﻿#region zh-CHS 2006 - 2007 DemoSoft 团队 | en 2006 - 2007 DemoSoft Team

//     NOTES
// ---------------
//
// This file is a part of the MMOSE(Massively Multiplayer Online Server Engine) for .NET.
//
//                              2006-2007 DemoSoft Team
//
//
// First Version : by H.Q.Cai - mailto:caihuanqing@hotmail.com

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

#region zh-CHS 包含名字空间 | en Include namespace
using System;
#endregion

namespace Demo.Mmose.Core.Item.General
{
    internal class GeneralItemDelta : BaseItemState
    {
        #region zh-CHS 枚举 | en Enum
        /// <summary>
        /// 
        /// </summary>
        [Flags]
        private enum ItemDeltaGeneral : ulong
        {
            None = 0x00000000,

            GoldUpdate                  = 0x00000001,
            WeightUpdate                = 0x00000002,
            StackableUpdate             = 0x00000004,
            DecayTimeUpdate             = 0x00000008,

            DecaysUpdate                = 0x00000010,
            PhysicalResistanceUpdate    = 0x00000020,
            FireResistanceUpdate        = 0x00000040,
            ColdResistanceUpdate        = 0x00000080,

            PoisonResistanceUpdate      = 0x00000100,
            EnergyResistanceUpdate      = 0x00000200,
       }
        #endregion

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private ItemDeltaGeneral m_ItemDelta = ItemDeltaGeneral.None;
        #endregion

        #region zh-CHS 共有属性 | en Public Properties
        /// <summary>
        /// 
        /// </summary>
        public bool GoldUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.GoldUpdate ) == ItemDeltaGeneral.GoldUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool WeightUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.WeightUpdate ) == ItemDeltaGeneral.WeightUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool StackableUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.StackableUpdate ) == ItemDeltaGeneral.StackableUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool DecayTimeUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.DecayTimeUpdate ) == ItemDeltaGeneral.DecayTimeUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool DecaysUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.DecaysUpdate ) == ItemDeltaGeneral.DecaysUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool PhysicalResistanceUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.PhysicalResistanceUpdate ) == ItemDeltaGeneral.PhysicalResistanceUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool FireResistanceUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.FireResistanceUpdate ) == ItemDeltaGeneral.FireResistanceUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool ColdResistanceUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.ColdResistanceUpdate ) == ItemDeltaGeneral.ColdResistanceUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool PoisonResistanceUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.PoisonResistanceUpdate ) == ItemDeltaGeneral.PoisonResistanceUpdate ? true : false; }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool EnergyResistanceUpdate
        {
            get { return ( m_ItemDelta & ItemDeltaGeneral.EnergyResistanceUpdate ) == ItemDeltaGeneral.EnergyResistanceUpdate ? true : false; }
        }
        #endregion

        #region zh-CHS 共有方法 | en Public Methods
        /// <summary>
        /// 
        /// </summary>
        public void DeltaGoldUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.GoldUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestoreGoldUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.GoldUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaWeightUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.WeightUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestoreWeightUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.WeightUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaStackableUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.StackableUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestoreStackableUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.StackableUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaDecayTimeUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.DecayTimeUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestoreDecayTimeUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.DecayTimeUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaDecaysUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.DecaysUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestoreDecaysUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.DecaysUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaPhysicalResistanceUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.PhysicalResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestorePhysicalResistanceUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.PhysicalResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaFireResistanceUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.FireResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestoreFireResistanceUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.FireResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaColdResistanceUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.ColdResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestoreColdResistanceUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.ColdResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaPoisonResistanceUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.PoisonResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestorePoisonResistanceUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.PoisonResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void DeltaEnergyResistanceUpdate()
        {
            m_ItemDelta |= ItemDeltaGeneral.EnergyResistanceUpdate;
        }

        /// <summary>
        /// 
        /// </summary>
        public void RestoreEnergyResistanceUpdate()
        {
            m_ItemDelta &= ~ItemDeltaGeneral.EnergyResistanceUpdate;
        }
        #endregion
    }
}
#endregion

